//////////////////////////////////////////////////////////////////////////
//	File: Camera.h
//
//	Author:	Omar Khan
//
//	Created: January 11, 2010
//
//	Purpose: Creating the camera that will be used by the game
//////////////////////////////////////////////////////////////////////////
#pragma once
#include <d3dx9.h>

#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define KEYUP(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)
class CCamera
{
private:
	IDirect3DDevice9* m_pDevice;
	float m_fAlpha, m_fBeta, m_fRadius, m_fFov;
	D3DXVECTOR3 m_Eye, m_Focus, m_Right, m_Look;

public:
	CCamera(void);
	~CCamera(void) {}

	void Init(IDirect3DDevice9* dev);

	//	Movement
	void Scroll(D3DXVECTOR3 vec);
	void Pitch(float f);
	void Yaw(float f);
	void Zoom(float f);
	void ChangeRadius(float f);

	//	Calculate Eye position
	void Update(float fDTime);

	D3DXMATRIX GetViewMatrix();
	D3DXMATRIX GetProjectionMatrix();
};
